#include <signal.h>
#include "thread.h"
#include "front_server.h"
#include "gf_server.h"
#include "Log.h"

using namespace std;

int main(int argc, char **argv)
{
	string path = "./logs";
	string log_level = "DEBUG";
	if (!init_logger(path, log_level)) {
		cout << "logger init failed log[@path | @level]" << endl;
		return -1;
	}

	vector<server *> servers;
	front_server *front = new front_server;
	gf_extract_server *gf_ex = new gf_extract_server;
	gf_match_server *gf_ma = new gf_match_server;
	
	front->add_gf_server(gf_ex);
	gf_ex->add_match_server(gf_ma);

	servers.push_back(front);
	servers.push_back(gf_ex);
	servers.push_back(gf_ma);

	for (vector<server *>::iterator it = servers.begin(); it != servers.end(); it++)
		(*it)->start();

	return 0;
}

